package com.mmd.sharding.web.api;

import com.mmd.sharding.service.DemoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author xch
 * 2023/4/20 13:24
 */

@RestController
@RequestMapping("/demo")
public class DemoController {

    @Resource
    private DemoService demoService;

    @GetMapping("/order/demo")
    public String orderDemo() {
        demoService.orderDemo();
        return "demo";
    }

    @GetMapping("/order/item/demo")
    public String orderItemDemo() {
        demoService.orderItemDemo();
        return "demo";
    }


    @GetMapping("/casewhen/valid01")
    public String caseWhenValid01() {
        demoService.caseWhenValid01();
        return "demo";
    }

    @GetMapping("/casewhen/valid02")
    public String caseWhenValid02() {
        demoService.caseWhenValid02();
        return "demo";
    }


    @GetMapping("/address/demo")
    public String addressDemo() {
        demoService.addressDemo();
        return "demo";
    }

    @GetMapping("/address/query")
    public String addressQuery() {
        demoService.addressQuery();
        return "demo";
    }
}
